[JS] How to manipulate a PHP Array in javascript?

Posted by rasouza on Stack Overflow See other posts from Stack Overflow or by rasouza
Published on 2010-06-15T19:56:34Z Indexed on 2010/06/15 20:02 UTC
Read the original article Hit count: 203

Filed under:
|

I have an Array in PHP which contains data from database. And it prints out also as a table in the same page which has an AJAX delete function.

Trying to explain better

The array contains debt sums related to many people, it is the application's main function. In the same page, there is a table containing every debt record related to the array, which can be deleted or edited using AJAX.

I have coded the part of deleting the record and removing the TR entry, but it's not enough: I'd like to change also the debt sum using AJAX which is an PHP Array.

What I have

I have the JS function which removes the TR when the delete button is clicked

// TR Fading when deleted
    $('.delete')
        .click(function() {
        $.ajax({
            type: 'GET',
            url: 'history/delete/id/'+$(this).attr('id')
        });
        $(this).parent().parent().fadeOut();
        return false;
        });

and I have the PHP array (image)

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript